﻿CREATE TABLE [dbo].[Order_Change_Item] (
    [Id]              INT              IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
    [CId]             INT              CONSTRAINT [DF_Order_Change_Item_CId] DEFAULT ((0)) NOT NULL,
    [OId]             UNIQUEIDENTIFIER CONSTRAINT [DF_Order_Change_Item_OId] DEFAULT (newid()) ROWGUIDCOL NULL,
    [ProductId]       INT              NULL,
    [ProductName]     NVARCHAR (50)    NULL,
    [UnitPrice]       DECIMAL (18, 2)  NULL,
    [Quantity]        INT              NULL,
    [Salesman]        NVARCHAR (50)    NULL,
    [SalesmanAccount] NVARCHAR (50)    NULL,
    [DepId]           INT              NULL,
    [CompanyId]       INT              NULL,
    [CreateDate]      DATETIME         NULL,
    [Description]     NVARCHAR (200)   NULL,
    [TradeDate]       DATETIME         NULL,
    CONSTRAINT [PK_Order_Change_Item_Id] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
CREATE NONCLUSTERED INDEX [IX_Order_Change_Item_OId]
    ON [dbo].[Order_Change_Item]([OId] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Order_Change_Item_CId]
    ON [dbo].[Order_Change_Item]([CId] ASC);

